<?php
namespace Home\Controller;
use Think\Controller;
class PrephonesController extends Controller {



 public function prephonelist(){
		

$premodel=M('presale');

    $pres=$premodel->order('id asc')->select();
    //调用试图层显示数据
      $this->pres=$pres;
       $this->display();

//echo $lost->getLastSQL();//本方法用于显示该表最后操作的SQL语句
//var_dump($this->findlist);

    }
//    public function phonelist(){
//     $phonemodel=M('phone');
//     //算总记录数
//     $records=$phonemodel->count();
//     echo $records;
//     //设置每页显示记录数
//     $pageSize=2;
//     //使用分页类生成分页的链接
//     $Page=new \Think\Page($records,$pageSize);
//     $this->link=$Page->show();
//     //获取分页数据
//     $this->phonelist=$phonemodel->order('id desc')->limit($Page->firstRow,$pageSize)->select();
// $this->display();


// }
public function detailpre($id){
        //调用模型层获取数据
       $premodel=M('presale');
       $pres=$premodel->select($id); 
       $this->pres=$pres;
       $this->display();
    }

}